<?php
/**
 * Modify ArchivePress Settings page
 *
 * @author University of London Computer Centre
 * @version 1.4.0 - Release Candidate 2
 * @package ArchivePress
 * @subpackage pages
 * @global ArchivePress $ArchivePress
 */

// globals
global $ArchivePress;

// actions URL
$responder = get_bloginfo( 'wpurl' ).'/wp-admin/admin.php?page=archivepress/pages/responder.php';


// CHECK FOR MESSAGES
$message = "";

// settings updated
if(array_key_exists("updated", $_GET)){
    $message = __("Settings saved", ARCHIVEPRESS);
}

if($message != ""){
    $message = '<div class="updated fade below-h2" id="message">
                    <p>
                        '.$message.'<br />
                    </p>
                </div>';
}

echo '<div class="wrap">
        <div class="icon32" id="icon-archivepress"><br /></div>
        <h2>ArchivePress '.__("Settings", ARCHIVEPRESS).'
            <span class="subtitle">'.__("Version: ", ARCHIVEPRESS).get_option(WP_ARCHIVEPRESS_PREFIX . "version").'</span>
        </h2>
        '.$message.'
        <form method="post" action="admin.php?page=archivepress/pages/settings.php">
            <input type="hidden" name="back" value="settings&noheader" />
            <input type="hidden" name="' . WP_ARCHIVEPRESS_PREFIX . 'action" value="settings" />';

// security
wp_nonce_field(WP_ARCHIVEPRESS_PREFIX . 'settings');

echo'
            <p class="arpr_alert">'.__("Modify these settings may affect your server performances: change these options only if you know exactly what you are doing.", ARCHIVEPRESS).'</p>
            <br />

            <h3>'.__("Plugin Info", ARCHIVEPRESS).'</h3>
            <table class="form-table">

                <tr valign="top">
                    <th scope="row">'.__("Feed Table Name").'</th>
                    <td>
                        '.$wpdb->prefix . WP_ARCHIVEPRESS_PREFIX . get_option(WP_ARCHIVEPRESS_PREFIX . "feedsTableName").'
                    </td>
                </tr>

                <tr valign="top">
                    <th scope="row">'.__("Feed Links Table Name").'</th>
                    <td>
                        '.$wpdb->prefix . WP_ARCHIVEPRESS_PREFIX . get_option(WP_ARCHIVEPRESS_PREFIX . "feedLinksTableName").'
                    </td>
                </tr>

                <tr valign="top">
                    <th scope="row">'.__("Feed Metadata Table Name").'</th>
                    <td>
                        '.$wpdb->prefix . WP_ARCHIVEPRESS_PREFIX . get_option(WP_ARCHIVEPRESS_PREFIX . "feedMetaTableName").'
                    </td>
                </tr>

                <tr valign="top">
                    <th scope="row">'.__("Feed Options Table Name").'</th>
                    <td>
                        '.$wpdb->prefix . WP_ARCHIVEPRESS_PREFIX . get_option(WP_ARCHIVEPRESS_PREFIX . "feedOptionsTableName").'
                    </td>
                </tr>

                <tr valign="top">
                    <th scope="row">'.__("ArchivePress Log Table Name").'</th>
                    <td>
                        '.$wpdb->prefix . WP_ARCHIVEPRESS_PREFIX . get_option(WP_ARCHIVEPRESS_PREFIX . "logTableName").'
                    </td>
                </tr>

            </table>

            <br /><br />

            <h3>'.__("Plugin Settings", ARCHIVEPRESS).'</h3>
            <table class="form-table">
                    <tr valign="top">
                        <th scope="row">'.__("Show what the plugin will do before to do it while you are adding a new Feed").'</th>
                        <td>
                            <fieldset>
                                <legend class="screen-reader-text">
                                    <span>'.__("Show what the plugin will do before to do it while you are adding a new Feed").'</span>
                                </legend>
                                <label for="' . WP_ARCHIVEPRESS_PREFIX . 'showWhatWillDo">
                                    <input name="' . WP_ARCHIVEPRESS_PREFIX . 'showWhatWillDo" type="checkbox" id="' . WP_ARCHIVEPRESS_PREFIX . 'showWhatWillDo" value="yes" '; if(get_option(WP_ARCHIVEPRESS_PREFIX . "showWhatWillDo") == "yes") echo 'checked="checked"'; echo' />
                                    '.__("check to Show").'
                                </label>
                            </fieldset>
                        </td>
                    </tr>

                    <tr valign="top">
                        <th scope="row"><label for="' . WP_ARCHIVEPRESS_PREFIX . 'htmlAllowedTags">'.__("HTML Allowed Tags").'</label></th>
                        <td>
                            <input type="text" class="regular-text" id="' . WP_ARCHIVEPRESS_PREFIX . 'htmlAllowedTags" name="' . WP_ARCHIVEPRESS_PREFIX . 'htmlAllowedTags" value="'.$ArchivePress->cleanOutput(get_option(WP_ARCHIVEPRESS_PREFIX . "htmlAllowedTags")).'" />
                            <span class="description">'.__("These tags WON'T be stripped from the fetched posts and comments.", ARCHIVEPRESS).'</span><br />
                            <span class="description arpr_alert">'.__("ALL the other tags and their content will be removed from posts and comments.", ARCHIVEPRESS).'</span>
                        </td>
                    </tr>

                    <tr valign="top">
                        <th scope="row">'.__("Save Contributors").'</th>
                        <td>
                            <fieldset>
                                <legend class="screen-reader-text">
                                    <span>'.__("Save Contributors").'</span>
                                </legend>
                                <label for="' . WP_ARCHIVEPRESS_PREFIX . 'saveContributors">
                                    <input name="' . WP_ARCHIVEPRESS_PREFIX . 'saveContributors" type="checkbox" id="' . WP_ARCHIVEPRESS_PREFIX . 'saveContributors" value="yes" '; if(get_option(WP_ARCHIVEPRESS_PREFIX . "saveContributors") == "yes") echo 'checked="checked"'; echo' />
                                    '.sprintf(__("Check to save the Blog name as Contributor. It will be displayed under the '%s' Link Category."),$ArchivePress->cleanOutput(get_option(WP_ARCHIVEPRESS_PREFIX . "defContributorLink"), ARCHIVEPRESS)) .'
                                </label>
                            </fieldset>
                        </td>
                    </tr>

                    <tr valign="top">
                        <th scope="row"><label for="' . WP_ARCHIVEPRESS_PREFIX . 'defContributorLink">'.__("Contributor Link Name").'</label></th>
                        <td>
                            <input type="text" class="regular-text" id="' . WP_ARCHIVEPRESS_PREFIX . 'defContributorLink" name="' . WP_ARCHIVEPRESS_PREFIX . 'defContributorLink" value="'.$ArchivePress->cleanOutput(get_option(WP_ARCHIVEPRESS_PREFIX . "defContributorLink")).'" />
                            <span class="description arpr_alert">'.__("Modify this value won't have any effect if you added already some feed.", ARCHIVEPRESS).'</span><br />
                            <span class="description arpr_tip">'.sprintf(__("Use the %s WordPress Admin Area %s to modify the Link Category Name.", ARCHIVEPRESS), "<a href='".get_bloginfo( 'wpurl' )."/wp-admin/link-manager.php'>", "</a>").'</span>
                        </td>
                    </tr>

                    <tr valign="top">
                        <th scope="row">'.__("Keep the Post Author").'</th>
                        <td>
                            <fieldset>
                                <legend class="screen-reader-text">
                                    <span>'.__("Keep the Post Author").'</span>
                                </legend>
                                <label for="' . WP_ARCHIVEPRESS_PREFIX . 'keepPostAuth">
                                    <input name="' . WP_ARCHIVEPRESS_PREFIX . 'keepPostAuth" type="checkbox" id="' . WP_ARCHIVEPRESS_PREFIX . 'keepPostAuth" value="yes" '; if(get_option(WP_ARCHIVEPRESS_PREFIX . "keepPostAuth") == "yes") echo 'checked="checked"'; echo' />
                                    '.__("Check to keep the post Author for the fetched posts.").'
                                </label>
                            </fieldset>
                        </td>
                    </tr>

                    <tr valign="top">
                        <th scope="row"><label for="' . WP_ARCHIVEPRESS_PREFIX . 'defAuthor">'.__("Default Author").'</label></th>
                        <td>
                            <input type="text" class="regular-text" id="' . WP_ARCHIVEPRESS_PREFIX . 'defAuthor" name="' . WP_ARCHIVEPRESS_PREFIX . 'defAuthor" value="'.$ArchivePress->cleanOutput(get_option(WP_ARCHIVEPRESS_PREFIX . "defAuthor")).'" />
                            <span class="description">'.__("This Author will be used in case it's not possible to find the original post author or if you decided to don't keep the original author.", ARCHIVEPRESS).'</span>
                        </td>
                    </tr>

                    <tr valign="top">
                        <th scope="row">'.__("Keep Post Categories").'</th>
                        <td>
                            <fieldset>
                                <legend class="screen-reader-text">
                                    <span>'.__("Keep Post Categories").'</span>
                                </legend>
                                <label for="' . WP_ARCHIVEPRESS_PREFIX . 'keepPostCategories">
                                    <input name="' . WP_ARCHIVEPRESS_PREFIX . 'keepPostCategories" type="checkbox" id="' . WP_ARCHIVEPRESS_PREFIX . 'keepPostCategories" value="yes" '; if(get_option(WP_ARCHIVEPRESS_PREFIX . "keepPostCategories") == "yes") echo 'checked="checked"'; echo' />
                                    '.__("Check if you want to use the blog name as default category for the fetched posts").'
                                </label>
                            </fieldset>
                        </td>
                    </tr>

                    <tr valign="top">
                        <th scope="row"><label for="' . WP_ARCHIVEPRESS_PREFIX . 'defCategory">'.__("Default Category").'</label></th>
                        <td>
                            <input type="text" class="regular-text" id="' . WP_ARCHIVEPRESS_PREFIX . 'defCategory" name="' . WP_ARCHIVEPRESS_PREFIX . 'defCategory" value="'.$ArchivePress->cleanOutput(get_option(WP_ARCHIVEPRESS_PREFIX . "defCategory")).'" />
                            <span class="description">'.__("In case you decided to DON'T use the blog name as category, it indicates which is the default category to use.", ARCHIVEPRESS).'</span><br />
                            <span class="description arpr_tip">'.sprintf(__("Choose '%s' if you want to use the %s WordPress Default Category %s", ARCHIVEPRESS), ArchivePressOptions::USE_DEF_CAT, "<a href='".get_bloginfo( 'wpurl' )."/wp-admin/categories.php'>", "</a>").'</span><br />
                            <span class="description arpr_tip">'.__("or use a valid Category ID for a different category", ARCHIVEPRESS).'</span><br />
                        </td>
                    </tr>

                    <tr valign="top">
                        <th scope="row">'.__("Use Categories As Tags").'</th>
                        <td>
                            <fieldset>
                                <legend class="screen-reader-text">
                                    <span>'.__("Use Categories As Tags").'</span>
                                </legend>
                                <label for="' . WP_ARCHIVEPRESS_PREFIX . 'useCategoriesAsTags">
                                    <input name="' . WP_ARCHIVEPRESS_PREFIX . 'useCategoriesAsTags" type="checkbox" id="' . WP_ARCHIVEPRESS_PREFIX . 'useCategoriesAsTags" value="yes" '; if(get_option(WP_ARCHIVEPRESS_PREFIX . "useCategoriesAsTags") == "yes") echo 'checked="checked"'; echo' />
                                    '.__("Check if you want to use the &lt;category&gt; Feed Tag as WordPress Tag for your fetched posts.").'
                                </label>
                            </fieldset>
                        </td>
                    </tr>

                    <tr valign="top">
                        <th scope="row">'.__("Try to Auto-Tag").'</th>
                        <td>
                            <fieldset>
                                <legend class="screen-reader-text">
                                    <span>'.__("Try to Auto-Tag").'</span>
                                </legend>
                                <label for="' . WP_ARCHIVEPRESS_PREFIX . 'tryAutoTag">
                                    <input name="' . WP_ARCHIVEPRESS_PREFIX . 'tryAutoTag" type="checkbox" id="' . WP_ARCHIVEPRESS_PREFIX . 'tryAutoTag" value="yes" '; if(get_option(WP_ARCHIVEPRESS_PREFIX . "tryAutoTag") == "yes") echo 'checked="checked"'; echo' />
                                    '.__("Check if you want to use Yahoo AutoTag to try to add tags to the fetched posts.").'
                                </label>
                            </fieldset>
                        </td>
                    </tr>

                    <tr valign="top">
                        <th scope="row"><label for="' . WP_ARCHIVEPRESS_PREFIX . 'YahooKey">'.__("Yahoo Key").'</label></th>
                        <td>
                            <input type="text" class="regular-text" id="' . WP_ARCHIVEPRESS_PREFIX . 'YahooKey" name="' . WP_ARCHIVEPRESS_PREFIX . 'YahooKey" value="'.$ArchivePress->cleanOutput(get_option(WP_ARCHIVEPRESS_PREFIX . "YahooKey")).'" />
                            <span class="description arpr_tip">'.__("You need a Yahoo Key to use the AutoTag Service.", ARCHIVEPRESS).'</span><br />
                            <span class="description arpr_tip">'.sprintf(__("More Info %s here %s", ARCHIVEPRESS), "<a href='http://developer.yahoo.com/'>", "</a>").'</span>
                        </td>
                    </tr>
            </table>

            <br /><br />

            <h3>'.__("Default Post Feed Settings", ARCHIVEPRESS).'</h3>
                <p>'.__("Each new Post Feed added will use these settings.", ARCHIVEPRESS).'</p>
                <table class="form-table">
                    <tr valign="top">
                        <th scope="row"><label for="' . WP_ARCHIVEPRESS_PREFIX . 'defFeedProtocol">'.__("Feed Protocol").'</label></th>
                        <td>
                            <select  name="' . WP_ARCHIVEPRESS_PREFIX . 'defFeedProtocol" id="' . WP_ARCHIVEPRESS_PREFIX . 'defFeedProtocol">
                                <option value="'.ArchivePressOptions::FEED_PROTOCOL_ATOM.'"'; if(ArchivePressOptions::FEED_PROTOCOL_ATOM == get_option(WP_ARCHIVEPRESS_PREFIX . "defFeedProtocol")) echo 'selected="selected"'; echo' >'.__("Atom", ARCHIVEPRESS).'</option>
                                <option value="'.ArchivePressOptions::FEED_PROTOCOL_RSS.'"'; if(ArchivePressOptions::FEED_PROTOCOL_RSS == get_option(WP_ARCHIVEPRESS_PREFIX . "defFeedProtocol")) echo 'selected="selected"'; echo' >'.__("Rss", ARCHIVEPRESS).'</option>
                            </select>
                            <span class="description">'.__("Each Blog can have more than one Feed (RSS, Atom, ...), so you can decide which one use as default.", ARCHIVEPRESS).'</span>
                        </td>
                    </tr>

                    <tr valign="top">
                        <th scope="row"><label for="' . WP_ARCHIVEPRESS_PREFIX . 'defRssVersion">'.__("Rss Feed Default Protocol Version").'</label></th>
                        <td>
                            <select  name="' . WP_ARCHIVEPRESS_PREFIX . 'defRssVersion" id="' . WP_ARCHIVEPRESS_PREFIX . 'defRssVersion">
                                <option value="'.ArchivePressOptions::RSS_VERSION_0_90.'"'; if(ArchivePressOptions::RSS_VERSION_0_90 == get_option(WP_ARCHIVEPRESS_PREFIX . "defRssVersion")) echo 'selected="selected"'; echo' >'.ArchivePressOptions::RSS_VERSION_0_90.'</option>
                                <option value="'.ArchivePressOptions::RSS_VERSION_0_91.'"'; if(ArchivePressOptions::RSS_VERSION_0_91 == get_option(WP_ARCHIVEPRESS_PREFIX . "defRssVersion")) echo 'selected="selected"'; echo' >'.ArchivePressOptions::RSS_VERSION_0_91.'</option>
                                <option value="'.ArchivePressOptions::RSS_VERSION_1_0.'"'; if(ArchivePressOptions::RSS_VERSION_1_0 == get_option(WP_ARCHIVEPRESS_PREFIX . "defRssVersion")) echo 'selected="selected"'; echo' >'.ArchivePressOptions::RSS_VERSION_1_0.'</option>
                                <option value="'.ArchivePressOptions::RSS_VERSION_2_0.'"'; if(ArchivePressOptions::RSS_VERSION_2_0 == get_option(WP_ARCHIVEPRESS_PREFIX . "defRssVersion")) echo 'selected="selected"'; echo' >'.ArchivePressOptions::RSS_VERSION_2_0.'</option>
                            </select>
                            <span class="description">'.__("In case of more than one Rss feed link, the plugin will use this Version.", ARCHIVEPRESS).'</span>
                        </td>
                    </tr>

                    <tr valign="top">
                        <th scope="row"><label for="' . WP_ARCHIVEPRESS_PREFIX . 'defAtomVersion">'.__("Atom Feed Default Protocol Version").'</label></th>
                        <td>
                            <select  name="' . WP_ARCHIVEPRESS_PREFIX . 'defAtomVersion" id="' . WP_ARCHIVEPRESS_PREFIX . 'defAtomVersion">
                                <option value="'.ArchivePressOptions::ATOM_VERSION_0_3.'"'; if(ArchivePressOptions::ATOM_VERSION_0_3 == get_option(WP_ARCHIVEPRESS_PREFIX . "defAtomVersion")) echo 'selected="selected"'; echo' >'.ArchivePressOptions::ATOM_VERSION_0_3.'</option>
                                <option value="'.ArchivePressOptions::ATOM_VERSION_1_0.'"'; if(ArchivePressOptions::ATOM_VERSION_1_0 == get_option(WP_ARCHIVEPRESS_PREFIX . "defAtomVersion")) echo 'selected="selected"'; echo' >'.ArchivePressOptions::ATOM_VERSION_1_0.'</option>
                            </select>
                            <span class="description">'.__("In case of more than one Atom feed link, the plugin will use this Version.", ARCHIVEPRESS).'</span>
                        </td>
                    </tr>

                    <tr valign="top">
                        <th scope="row">'.__("Activate Feed").'</th>
                        <td>
                            <fieldset>
                                <legend class="screen-reader-text">
                                    <span>'.__("Activate Feed").'</span>
                                </legend>
                                <label for="' . WP_ARCHIVEPRESS_PREFIX . 'justAddedIsActive">
                                    <input name="' . WP_ARCHIVEPRESS_PREFIX . 'justAddedIsActive" type="checkbox" id="' . WP_ARCHIVEPRESS_PREFIX . 'justAddedIsActive" value="yes" '; if(get_option(WP_ARCHIVEPRESS_PREFIX . "justAddedIsActive") == "yes") echo 'checked="checked"'; echo' />
                                    '.__("Check to make each new Feed active by default.").'
                                </label>
                            </fieldset>
                        </td>
                    </tr>

                    <tr valign="top">
                        <th scope="row"><label for="' . WP_ARCHIVEPRESS_PREFIX . 'defFeedFetchInt">'.__("Fetch Interval").'</label></th>
                        <td>
                            <select  name="' . WP_ARCHIVEPRESS_PREFIX . 'defFeedFetchInt" id="' . WP_ARCHIVEPRESS_PREFIX . 'defFeedFetchInt">';
                            // get intervals
                            $intervals = array(
                                                    ArchivePressOptions::FETCH_INTERVAL_HOURLY  => __("Every Hour", ARCHIVEPRESS),
                                                    ArchivePressOptions::FETCH_INTERVAL_FOURTAD => __("Four Times a Day", ARCHIVEPRESS),
                                                    ArchivePressOptions::FETCH_INTERVAL_TID     => __("Three Times a Day", ARCHIVEPRESS),
                                                    ArchivePressOptions::FETCH_INTERVAL_BID     => __("Two Times a Day", ARCHIVEPRESS),
                                                    ArchivePressOptions::FETCH_INTERVAL_DAILY   => __("Every Day", ARCHIVEPRESS)
                                               );

                            foreach($intervals as $value => $text) {
                                echo '
                                <option value="'.$value.'"'; if($value == get_option(WP_ARCHIVEPRESS_PREFIX . "defFeedFetchInt")) echo 'selected="selected"'; echo' >'.$ArchivePress->cleanOutput($text).'</option>
                                ';
                            }
    echo'
                            </select>
                            <span class="description">'.__("How often the Feed has to be fetched.", ARCHIVEPRESS).'</span> <br /><span class="description arpr_tip">'.__("Too often generate more trafic on your blog, but too infrequently could let your server use too many resources.", ARCHIVEPRESS).'</span>
                        </td>
                    </tr>

                    <tr valign="top">
                        <th scope="row">'.__("Fetch Comments").'</th>
                        <td>
                            <fieldset>
                                <legend class="screen-reader-text">
                                    <span>'.__("Fetch Comments").'</span>
                                </legend>
                                <label for="' . WP_ARCHIVEPRESS_PREFIX . 'postFetchComments">
                                    <input name="' . WP_ARCHIVEPRESS_PREFIX . 'postFetchComments" type="checkbox" id="' . WP_ARCHIVEPRESS_PREFIX . 'postFetchComments" value="yes" '; if(get_option(WP_ARCHIVEPRESS_PREFIX . "postFetchComments") == "yes") echo 'checked="checked"'; echo' />
                                    '.__("Check to fetch also comments for each Feed").'
                                </label>
                            </fieldset>
                        </td>
                    </tr>

                    <tr valign="top">
                        <th scope="row">'.__("Follow PermaLinks").'</th>
                        <td>
                            <fieldset>
                                <legend class="screen-reader-text">
                                    <span>'.__("Follow PermaLinks").'</span>
                                </legend>
                                <label for="' . WP_ARCHIVEPRESS_PREFIX . 'followPermaLink">
                                    <input name="' . WP_ARCHIVEPRESS_PREFIX . 'followPermaLink" type="checkbox" id="' . WP_ARCHIVEPRESS_PREFIX . 'followPermaLink" value="yes" '; if(get_option(WP_ARCHIVEPRESS_PREFIX . "followPermaLink") == "yes") echo 'checked="checked"'; echo' />
                                    '.__("Check to try to download and save the ORIGINAL content from the Blog instead of using the Feed one").'
                                </label>
                            </fieldset>
                        </td>
                    </tr>

                    <tr valign="top">
                        <th scope="row">'.__("Embed Media").'</th>
                        <td>
                            <fieldset>
                                <legend class="screen-reader-text">
                                    <span>'.__("Embed Media").'</span>
                                </legend>
                                <label for="' . WP_ARCHIVEPRESS_PREFIX . 'embedMedia">
                                    <input name="' . WP_ARCHIVEPRESS_PREFIX . 'embedMedia" type="checkbox" id="' . WP_ARCHIVEPRESS_PREFIX . 'embedMedia" value="yes" '; if(get_option(WP_ARCHIVEPRESS_PREFIX . "embedMedia") == "yes") echo 'checked="checked"'; echo' />
                                    '.__("Check to download and store the post images instead of use links to the original files").'
                                </label>
                            </fieldset>
                        </td>
                    </tr>

                    <tr valign="top">
                        <th scope="row"><label for="' . WP_ARCHIVEPRESS_PREFIX . 'defPostStatus">'.__("Post Status").'</label></th>
                        <td>
                            <select  name="' . WP_ARCHIVEPRESS_PREFIX . 'defPostStatus" id="' . WP_ARCHIVEPRESS_PREFIX . 'defPostStatus">
                                <option value="'.ArchivePressOptions::POST_DRAFT.'"'; if(ArchivePressOptions::POST_DRAFT == get_option(WP_ARCHIVEPRESS_PREFIX . "defPostStatus")) echo 'selected="selected"'; echo' >'.__("Draft", ARCHIVEPRESS).'</option>
                                <option value="'.ArchivePressOptions::POST_PENDING.'"'; if(ArchivePressOptions::POST_PENDING == get_option(WP_ARCHIVEPRESS_PREFIX . "defPostStatus")) echo 'selected="selected"'; echo' >'.__("Pending", ARCHIVEPRESS).'</option>
                                <option value="'.ArchivePressOptions::POST_PUBLISH.'"'; if(ArchivePressOptions::POST_PUBLISH == get_option(WP_ARCHIVEPRESS_PREFIX . "defPostStatus")) echo 'selected="selected"'; echo' >'.__("Published", ARCHIVEPRESS).'</option>
                            </select>
                            <span class="description">'.__("Indicates the status for any post added", ARCHIVEPRESS).'</span>
                        </td>
                    </tr>

                    <tr valign="top">
                        <th scope="row">'.__("Excerpt").'</th>
                        <td>
                            <fieldset>
                                <legend class="screen-reader-text">
                                    <span>'.__("Excerpt").'</span>
                                </legend>
                                <label for="' . WP_ARCHIVEPRESS_PREFIX . 'tryToFindExcerpt">
                                    <input name="' . WP_ARCHIVEPRESS_PREFIX . 'tryToFindExcerpt" type="checkbox" id="' . WP_ARCHIVEPRESS_PREFIX . 'tryToFindExcerpt" value="yes" '; if(get_option(WP_ARCHIVEPRESS_PREFIX . "tryToFindExcerpt") == "yes") echo 'checked="checked"'; echo' />
                                    '.__("Check if you want the plugin will create excerpts for the posts added").'
                                </label>
                            </fieldset>
                        </td>
                    </tr>

                    <tr valign="top">
                        <th scope="row"><label for="' . WP_ARCHIVEPRESS_PREFIX . 'defCommentsStatus">'.__("Comment Status").'</label></th>
                        <td>
                            <select  name="' . WP_ARCHIVEPRESS_PREFIX . 'defCommentsStatus" id="' . WP_ARCHIVEPRESS_PREFIX . 'defCommentsStatus">
                                <option value="'.ArchivePressOptions::COMMENTS_CLOSED.'"'; if(ArchivePressOptions::COMMENTS_CLOSED == get_option(WP_ARCHIVEPRESS_PREFIX . "defCommentsStatus")) echo 'selected="selected"'; echo' >'.__("Closed", ARCHIVEPRESS).'</option>
                                <option value="'.ArchivePressOptions::COMMENTS_OPEN.'"'; if(ArchivePressOptions::COMMENTS_OPEN == get_option(WP_ARCHIVEPRESS_PREFIX . "defCommentsStatus")) echo 'selected="selected"'; echo' >'.__("Open", ARCHIVEPRESS).'</option>
                            </select>
                            <span class="description">'.__("Indicates if to allow comments for the posts added.", ARCHIVEPRESS).'</span>
                        </td>
                    </tr>

                </table>

            <br /><br />

            <h3>'.__("Default Comment Feed Settings", ARCHIVEPRESS).'</h3>
            <p>'.__("Each new Comment Feed added will use these settings.", ARCHIVEPRESS).'</p>
            <table class="form-table">

                <tr valign="top">
                    <th scope="row">'.__("Comment Status").'</th>
                    <td>
                        <fieldset>
                            <legend class="screen-reader-text">
                                <span>'.__("Comment Status").'</span>
                            </legend>
                            <label for="' . WP_ARCHIVEPRESS_PREFIX . 'areCommentsApproved">
                                <input name="' . WP_ARCHIVEPRESS_PREFIX . 'areCommentsApproved" type="checkbox" id="' . WP_ARCHIVEPRESS_PREFIX . 'areCommentsApproved" value="yes" '; if(get_option(WP_ARCHIVEPRESS_PREFIX . "areCommentsApproved") == "yes") echo 'checked="checked"'; echo' />
                                '.sprintf(__("Check if you want the comments fetched will be approved by default. Don't check means to use the %s WordPress Settings %s", ARCHIVEPRESS), "<a href='".get_bloginfo( 'wpurl' )."/wp-admin/options-discussion.php'>", "</a>").'
                            </label>
                        </fieldset>
                    </td>
                </tr>

                <tr valign="top">
                    <th scope="row">'.__("Try to fetch comments for TypePad (Standard)").'</th>
                    <td>
                        <fieldset>
                            <legend class="screen-reader-text">
                                <span>'.__("Try to fetch comments for TypePad (Standard)").'</span>
                            </legend>
                            <label for="' . WP_ARCHIVEPRESS_PREFIX . 'tryTypePadStandard">
                                <input name="' . WP_ARCHIVEPRESS_PREFIX . 'tryTypePadStandard" type="checkbox" id="' . WP_ARCHIVEPRESS_PREFIX . 'tryTypePadStandard" value="yes" '; if(get_option(WP_ARCHIVEPRESS_PREFIX . "tryTypePadStandard") == "yes") echo 'checked="checked"'; echo' />
                                '.__("Check if you want the plugin tries to fetch comments also for the TypePad Blogs (SLOW!)", ARCHIVEPRESS).'<br />
                            </label>
                        </fieldset>
                    </td>
                </tr>

            </table>

            <br /><br />

            <h3>'.__("Crontab Settings", ARCHIVEPRESS).'</h3>
            <p>'.__("These are the scheduling settings.", ARCHIVEPRESS).'</p>
            <p>'.__("WP cron > it's a fake cron: it works ONLY if someone surfs the website or the admin area", ARCHIVEPRESS).'</p>
            <p>'.__("Web cron > you have to use a web cron system 'to curl' the following address: <b>".get_bloginfo( 'wpurl' )."?arpr_key=".get_option(WP_ARCHIVEPRESS_PREFIX . "cronKey")."</b>", ARCHIVEPRESS).'</p>
            <p>'.__("Unix cron > you have to use the classic unix cron and add a cronjob like <b>php /your-blog arpr_key=".get_option(WP_ARCHIVEPRESS_PREFIX . "cronKey")."", ARCHIVEPRESS).'</b></p>
            <p class="arpr_tip">'.__("Keep in mind that if you scheduled a feed daily and the cron hourly, it means the script will look for feed to fetch every hour BUT IT WILL FETCH THEM EVERY DAY, according to the feed fetching interval", ARCHIVEPRESS).'</p>
            <table class="form-table">

                <tr valign="top">
                    <th scope="row"><label for="' . WP_ARCHIVEPRESS_PREFIX . 'cronType">'.__("Crontab").'</label></th>
                    <td>
                        <select  name="' . WP_ARCHIVEPRESS_PREFIX . 'cronType" id="' . WP_ARCHIVEPRESS_PREFIX . 'cronType">
                            <option value="'.ArchivePressOptions::CRON_WPCRON.'"'; if(ArchivePressOptions::CRON_WPCRON == get_option(WP_ARCHIVEPRESS_PREFIX . "cronType")) echo 'selected="selected"'; echo' >'.__("WP cron", ARCHIVEPRESS).'</option>
                            <option value="'.ArchivePressOptions::CRON_WEBCRON.'"'; if(ArchivePressOptions::CRON_WEBCRON == get_option(WP_ARCHIVEPRESS_PREFIX . "cronType")) echo 'selected="selected"'; echo' >'.__("Web cron", ARCHIVEPRESS).'</option>
                            <option value="'.ArchivePressOptions::CRON_UNIXCRON.'"'; if(ArchivePressOptions::CRON_UNIXCRON == get_option(WP_ARCHIVEPRESS_PREFIX . "cronType")) echo 'selected="selected"'; echo' >'.__("Unix cron", ARCHIVEPRESS).'</option>
                        </select>
                    </td>
                </tr>

            </table>

            <br /><br />

            <h3>'.__("ArchivePress Log Settings", ARCHIVEPRESS).'</h3>
            <p>'.__("These are the Log System settings.", ARCHIVEPRESS).'</p>
            <table class="form-table">
                <tr valign="top">
                    <th scope="row"><label for="' . WP_ARCHIVEPRESS_PREFIX . 'defLogStatus">'.__("Log Status").'</label></th>
                    <td>
                        <select  name="' . WP_ARCHIVEPRESS_PREFIX . 'defLogStatus" id="' . WP_ARCHIVEPRESS_PREFIX . 'defLogStatus">
                            <option value="'.ArchivePressLog::LOG_ON.'"'; if(ArchivePressLog::LOG_ON == get_option(WP_ARCHIVEPRESS_PREFIX . "defLogStatus")) echo 'selected="selected"'; echo' >'.__("On", ARCHIVEPRESS).'</option>
                            <option value="'.ArchivePressLog::LOG_OFF.'"'; if(ArchivePressLog::LOG_OFF == get_option(WP_ARCHIVEPRESS_PREFIX . "defLogStatus")) echo 'selected="selected"'; echo' >'.__("Off", ARCHIVEPRESS).'</option>
                        </select>
                    </td>
                </tr>

                <tr valign="top">
                    <th scope="row"><label for="' . WP_ARCHIVEPRESS_PREFIX . 'defLogLevel">'.__("Log Level").'</label></th>
                    <td>
                        <select  name="' . WP_ARCHIVEPRESS_PREFIX . 'defLogLevel" id="' . WP_ARCHIVEPRESS_PREFIX . 'defLogLevel">
                            <option value="'.ArchivePressLog::LOG_BASIC.'"'; if(ArchivePressLog::LOG_BASIC == get_option(WP_ARCHIVEPRESS_PREFIX . "defLogLevel")) echo 'selected="selected"'; echo' >'.__("Basic", ARCHIVEPRESS).'</option>
                            <option value="'.ArchivePressLog::LOG_DEBUG.'"'; if(ArchivePressLog::LOG_DEBUG == get_option(WP_ARCHIVEPRESS_PREFIX . "defLogLevel")) echo 'selected="selected"'; echo' >'.__("Debug", ARCHIVEPRESS).'</option>
                        </select>
                    </td>
                </tr>

            </table>

            <br />

            <p class="submit">
            <input type="submit" class="button-primary" value="'.__('Save Settings', ARCHIVEPRESS).'" />
            </p>';

echo '
        </form>
     </div>';
?>